package com.ds.infrastructure.hyperspace.common;

import com.ds.infrastructure.hyperspace.common.config.ContainerConfig;
import com.ds.infrastructure.hyperspace.common.flow.handler.FlowHandler;
import com.ds.infrastructure.hyperspace.extension.DataExtractor;

/**
 * Entrance for match
 * @author  Weishaoying
 */
public interface Container<T> {

    /**
     * Initialize config, pipelines, endpoint, flow handlers etc...
     * @param containerConfig
     */
    void start(ContainerConfig containerConfig);

    /**
     * Find target endpoint by name space
     * @param nameSpace
     * @return
     */
    T getTargetEndpoint(String nameSpace);

    /**
     * Get DataExtractor extension
     * @param id
     * @return
     */
    DataExtractor getDataExtractor(String id);

    /**
     * Get Operator
     * @param name
     * @return
     */
    Operator getOperator(String name);

    /**
     * Get flow handler
     * @param name
     * @return
     */
    FlowHandler getFlowHandler(String name);

    /**
     * Release correlated resources
     */
    void shutdown();
}
